
$(function(){

	//初始化表单
	$.ajaxSetup ({cache: false}); 
})

function _CshowFeedSend()
{
	Boxy.load('http://weidiandi.com/index.php?r=feed/showfeedsendhtml', {title: "写点滴",unloadOnHide:true,boxyType:true,modal:true});
}

//文本框提示
function _Cnormal(id,times)  
{  
    var obj=$("#"+id);  
    obj.css("background-color","#FFF");  
    if(times<0)  
    {  
        return;  
    }  
    times=times-1;  
    setTimeout("_Cerror('"+id+"',"+times+")",150);  
}  
function _Cerror(id,times)  
{  
    var obj=$("#"+id);  
    obj.css("background-color","#F6CECE");  
    times=times-1;  
    setTimeout("_Cnormal('"+id+"',"+times+")",150);  
} 

/**
*函数名 : delSpaceTrim/delSpaceTrimLeft/delSpaceTrimRight/delSpaceTrimAll
*功能   : 删除字符串的空格
*参数   : id : 表单项的id属性

*返回值 : value
*/
//删除字符串俩端的空格
function delSpaceTrim(id){ 
	var o =document.getElementById(id);
	if(o.value=o.value.trim()){ 
		return o.value; 
	}
}
String.prototype.trim =function(){
    return this.replace(/(^\s*)|(\s*$)/g,""); 
}

//删除字符串左端的空格
function delSpaceTrimLeft(id){
	var o =document.getElementById(id);
	if(o.value=o.value.trimleft()){ 
		return o.value; 
	}
}
String.prototype.trimleft=function(){ 
    return this.replace(/(^\s*)/g,""); 
} 

//删除字符串右端的空格
function delSpaceTrimRight(id){ 	
	var o =document.getElementById(id);
	if(o.value=o.value.trimright()){ 
		return o.value; 
	}
}
String.prototype.trimright=function(){ 
    return this.replace(/(\s*$)/g,""); 
}

//删除所有空格
function delSpaceTrimAll(id){
	var o =document.getElementById(id);
	if(o.value=o.value.trimall()){ 
		return o.value; 
	}
}
String.prototype.trimall=function(){
    return this.replace(/\s+/g,"");
}